package cn.cqie.attendance.manager.dao;

import cn.cqie.attendance.common.util.Page;
import cn.cqie.attendance.manager.pojo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author 697
 * @date 2021/7/2 14:33
 */
@Mapper
public interface AdminCourseDao {


    /**
     *查询课程信息 可以组合迷糊查询
     * @param adminCourseSerch
     * @return
     */
    List<AdminCourse> queryAllCourseInfo(@Param("adminCourseSerch") AdminCourseSerch adminCourseSerch);


    /**
     * 根据ID查询课程信息
     * @param courseId　id
     * @return
     */
    List<AdminCourse> queryCourseInfoById(@Param("courseId")Integer courseId);


    /**
     * 查询所有老师选择实训老师
     * @return
     */
    List<AdminTeacher> queryChooseTrainerTeacher();


    /**
     * 新增课程信息 不包括实训老师
     * @param adminCourse
     * @return
     */
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    int addCourseInfoNoTrainTeacher(@Param("adminCourse") AdminCourse adminCourse);


    /**
     * 新增实训老师
     * @param adminTrainTeacherCourse
     * @return
     */
    int addTrainTeacher(AdminTrainTeacherCourse adminTrainTeacherCourse);


    /**
     * 判断课程名重复的情况下是否课程时间也重复
     * @param adminCourse
     * @return
     */
    int queryCourseTimeCount(AdminCourse adminCourse);


    /**
     * 根据id编辑课程信息 不包含实训老师
     * @param adminCourse
     * @return
     */
    int updateCourseByIdNoTrainTeacher(@Param("adminCourse") AdminCourse adminCourse);



    /**
     * 根据id修改课程实训老师
     * @param adminTrainTeacherCourse
     * @return
     */
    int updateTrainTeacher(@Param("adminTrainTeacherCourse")AdminTrainTeacherCourse adminTrainTeacherCourse);


    /**
     * 根据课程id删除课程实训老师
     * @param courseId 课程id
     * @return
     */
    int deleteTrainerTeacherByCourseId(@Param("courseId")Integer courseId);


    /**
     * 课程选择学生
     * @param adminCourseStudentMsg 学生部分信息
     * @return
     */
    int addStudentToCourse(@Param("adminCourseStudentMsg")AdminCourseStudentMsg adminCourseStudentMsg);


    /**
     * 判断查询课程中学生是否重复
     * @param adminCourseStudentMsg
     * @return
     */
    int queryCountStudentInCourse(@Param("adminCourseStudentMsg")AdminCourseStudentMsg adminCourseStudentMsg);


    /**
     * 根据学生id查询学生
     * @param studentId
     * @return
     */
    List<AdminStudent> queryStudentByStudentId(@Param("studentId")Integer studentId);


    /**
     * 根据分组id查询学生
     * @param group
     * @return
     */
    List<AdminStudent> queryStudentByGroupId(@Param("groupId")Integer group);


    /**
     * 根据课程ID删除课程信息
     * @param courseId 课程ID
     * @return
     */
    int deleteCourseById(@Param("courseId")Integer courseId);


    /**
     * 根据班级id查询跟班级夏的学生 用于复制
     * @param courseId
     * @return
     */
    List<AdminCourseStudentMsg> queryStudentByCourseId(@Param("courseId")Integer courseId);


}
